package com.siloam.dao;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.siloam.module.ArticleCategory;

public class ArticleCategoryDao {

	private SqlSession sqlSession;

	public SqlSession getSqlSession() {
		return sqlSession;
	}

	public void setSqlSession(SqlSession sqlSession) {
		this.sqlSession = sqlSession;
	}

	private String getMapper(String method) {
		return "com.siloam.sqlmap.ArticleCategoryMapper." + method;
	}

	public List<ArticleCategory> findAll(){
		return sqlSession.selectList(getMapper("findAll"));
	}
	
	public ArticleCategory load(int id){
		return sqlSession.selectOne(getMapper("load"), id);
	}
	
}
